#!/bin/bash
vpspackversion=3.5k
OS=`uname -m`;
fecha=`cat /etc/VpsPackdir/fecha`;
ip=`wget -qO- ipv4.icanhazip.com`;
MYIP=`wget -qO- ipv4.icanhazip.com`;
MYIP2="s/xxxxxxxxx/$MYIP/g";
adaptador=`ifconfig | awk 'NR==1{print substr($1,1,length($1)-1); }'`;
squidports=`netstat -tunlp | grep squid | grep -vE 'udp' | awk '{print substr($4,4); }' > /tmp/squid.txt && echo | cat /tmp/squid.txt | tr '\n' ' ' > /etc/VpsPackdir/squidports.txt && cat /etc/VpsPackdir/squidports.txt`;
sslports=`netstat -tunlp | grep stunnel4 | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/ssl.txt && echo | cat /tmp/ssl.txt | tr '\n' ' ' > /etc/VpsPackdir/sslports.txt && cat /etc/VpsPackdir/sslports.txt`;
sshports=`netstat -tunlp | grep sshd | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/ssh.txt && echo | cat /tmp/ssh.txt | tr '\n' ' ' > /etc/VpsPackdir/sshports.txt && cat /etc/VpsPackdir/sshports.txt`;
dantedports=`netstat -tunlp | grep danted | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/danted.txt && echo | cat /tmp/danted.txt | tr '\n' ' ' > /etc/VpsPackdir/dantedports.txt && cat /etc/VpsPackdir/dantedports.txt`;
sockdports=`netstat -tunlp | grep sockd | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/sockd.txt && echo | cat /tmp/sockd.txt | tr '\n' ' ' > /etc/VpsPackdir/sockdports.txt && cat /etc/VpsPackdir/sockdports.txt`;
microports=`netstat -tunlp | grep microsocks | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/micro.txt && echo | cat /tmp/micro.txt | tr '\n' ' ' > /etc/VpsPackdir/microports.txt && cat /etc/VpsPackdir/microports.txt`;
dropbearports=`netstat -tunlp | grep dropbear | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/dropbear.txt && echo | cat /tmp/dropbear.txt | tr '\n' ' ' > /etc/VpsPackdir/dropbearports.txt && cat /etc/VpsPackdir/dropbearports.txt`;
pythonports=`netstat -tunlp | grep python | grep -vE '127.0.0.1' | awk '{print substr($4,9); }' > /tmp/python.txt && echo | cat /tmp/python.txt | tr '\n' ' ' > /etc/VpsPackdir/pythonports.txt && cat /etc/VpsPackdir/pythonports.txt`;
badvpnports=`netstat -tunlp | grep badvpn-udpgw | grep tcp | awk '{print substr($4,11); }' > /tmp/badvpn.txt && echo | cat /tmp/badvpn.txt | tr '\n' ' ' > /etc/VpsPackdir/badvpnports.txt && cat /etc/VpsPackdir/badvpnports.txt`;
openvpnports=`netstat -tunlp | grep openvpn | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/openvpn.txt && echo | cat /tmp/openvpn.txt | tr '\n' ' ' > /etc/VpsPackdir/openvpnports.txt && cat /etc/VpsPackdir/openvpnports.txt`;
nginxports=`netstat -tunlp | grep nginx | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/nginx.txt && echo | cat /tmp/nginx.txt | tr '\n' ' ' > /etc/VpsPackdir/nginxports.txt && cat /etc/VpsPackdir/nginxports.txt`;
obfsports=`netstat -tunlp | grep obfs | grep 0.0.0.0: | awk '{print substr($4,9); }' > /tmp/obfs.txt && echo | cat /tmp/obfs.txt | tr '\n' ' ' > /etc/VpsPackdir/obfsports.txt && cat /etc/VpsPackdir/obfsports.txt`;
v2rayports=`netstat -tunlp | grep v2ray | grep LISTEN | grep -vE '127.0.0.1' | awk '{print substr($4,4); }' > /tmp/v2.txt && echo | cat /tmp/v2.txt | tr '\n' ' ' > /etc/VpsPackdir/v2ports.txt && cat /etc/VpsPackdir/v2ports.txt`;
cloakports=`netstat -tunlp | grep ck-server | grep LISTEN | grep -vE '127.0.0.1' | awk '{print substr($4,4); }' > /tmp/cloak.txt && echo | cat /tmp/cloak.txt | tr '\n' ' ' > /etc/VpsPackdir/cloakports.txt && cat /etc/VpsPackdir/cloakports.txt`;
shadowrports=`netstat -tunlp | grep python | grep ::: | awk '{print substr($4,4); }' > /tmp/shadowr.txt && echo | cat /tmp/shadowr.txt | tr '\n' ' ' > /etc/VpsPackdir/shadowrports.txt && cat /etc/VpsPackdir/shadowrports.txt`;
distribution=$(lsb_release -si);
os_version=$(lsb_release -sr);
memorialibre=`awk '/^Mem/ {printf($4);}' <(free -m)`;
memoriauso=`awk '/^Mem/ {printf($3);}' <(free -m)`;
memoriatotal=`awk '/^Mem/ {printf($2);}' <(free -m)`;
memoriacache=`awk '/^Mem/ {printf($6);}' <(free -m)`;
xiptables=`if iptables -L |grep torrent 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xssh=`if netstat -tunlp |grep ssh 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xsquid=`if netstat -tunlp |grep squid 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xstunnel=`if netstat -tunlp |grep stunnel 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xbadvpn=`if netstat -tunlp |grep badvpn 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xdropbear=`if netstat -tunlp |grep dropbear 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xssh=`if netstat -tunlp |grep ssh 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xshadowsocks=`if netstat -tunlp |grep ss-server 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xwebmin=`if netstat -tunlp |grep webmin 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xpython=`if netstat -tunlp |grep python 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xopenvpn=`if netstat -tunlp |grep openvpn 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xsocks5=`if netstat -tunlp |grep danted 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xsockd=`if netstat -tunlp |grep sockd 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xmicro=`if netstat -tunlp |grep microsocks 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xnginx=`if netstat -tunlp |grep nginx 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xdns=`if netstat -tunlp |grep dotnet 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xv2ray=`if netstat -tunlp |grep v2ray 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xcloak=`if netstat -tunlp |grep ck-server 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
xiptables=`if iptables -L |grep torrent 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
if [ $(id -u) -eq 0 ]
then
clear
else
echo -e "Ejecute el script como usuario \033[1;32mroot\033[0m"
exit
fi
if [ -d /etc/VpsPackdir ]
then
true
else
mkdir /etc/VpsPackdir
fi
if [ -d /etc/VpsPackdir/senha ]
then
true
else
mkdir /etc/VpsPackdir/senha
fi
if [ -d /etc/VpsPackdir/limite ]
then
true
else
mkdir /etc/VpsPackdir/limite
fi
function configurarsquid(){
clear
cat -n /etc/issue |grep 1 |cut -d' ' -f6,7,8 |sed 's/1//' |sed 's/	//' > /etc/so
if [ -f /etc/os-release ]
then
sistema=$(cat /etc/os-release |grep "PRETTY_NAME" | awk -F = '{print $2}' |sed 's/"//g')
else
sistema=Null
fi
echo -e "\033[1;31mInstalando SSH/Squid VPSPack $vpspackversion!\033[0m"
clear
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;31m-----> \033[01;37mScript VPSPACK $vpspackversion › PowerMX\033[0m"
echo -e "\033[1;31m-----> \033[01;37mSistema:\033[1;31m $sistema"
echo -e "\033[1;31m-----> \033[01;37mSu ip agregada:\033[1;31m $ip"
echo -e "\033[1;31m-----> \033[1;37mSQUID:\033[1;31m 3128, 80, 8080\033[0m"
echo -e "\033[1;31m-----> \033[1;37mSSH Puertos: \033[1;31m22\033[0m"
echo -e "\033[1;31m-----> \033[1;37mSSH IP/Hosts: \033[1;31m$ip, localhost, 127.0.0.1\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
function sshd_config(){
echo '
Banner /etc/banner
PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes
' >> /etc/ssh/sshd_config
}
function addihost(){ echo '#!/bin/bash
echo -e "\033[1;31mHosts actualmente permitidos\n\n\033[1;32m$(cat /etc/payloads)\n\033[0m"
echo "Que host desea agregar ?"
read -p ": " host
echo "$host" >> /etc/payloads
squid -k reconfigure > /dev/null 2> /dev/null
squid3 -k reconfigure > /dev/null 2> /dev/null
echo "$host Adicionado" ' > /bin/addhost
chmod a+x /bin/addhost
}
function removerhostf(){ echo '#!/bin/bash
echo -e "\033[1;31mHosts actualmente permitidos\n\n\033[1;32m$(cat /etc/payloads)\n\033[0m"
echo -ne "\033[1;37mQue host desea remover: \033[0m"
read host
hosts = $(cat /etc/payloads |grep -v $host)
echo "$hosts" > /etc/payloads
squid -k reconfigure >/dev/null 2>/dev/null
squid3 -k reconfigure >/dev/null 2>/dev/null
echo -e "\n\033[1;32mHost Removido\033[0m"
' > /bin/removerhost
}
function payloads(){ echo ".claro.com.br
.claro.com.sv
.vivo.com.br
.ddivulga.com" > /etc/payloads
}
if cat /etc/so |grep -i debian |grep 10 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Debian 10, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSpack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
addihost
removerhostf
payloads
service squid restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i debian |grep 9 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Debian 9, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSpack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
addihost
removerhostf
payloads
service squid restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i debian |grep 8 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Debian 8, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid3 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid3/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid3/squid.conf
addihost
removerhostf
payloads
service squid3 restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/lsb-release |grep -i ubuntu |grep 19 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Ubuntu 19, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
addihost
removerhostf
payloads
service squid restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 80, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i ubuntu |grep 18 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Ubuntu 18, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
addihost
removerhostf
payloads
service squid restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i ubuntu |grep 17 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Ubuntu 18, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
addihost
removerhostf
payloads
service squid restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i ubuntu |grep 16 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando Ubuntu 16, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid3 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
addihost
removerhostf
payloads
service squid restart 1> /dev/null 2> /dev/null
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts escriba \033[1;32maddhost
\033[1;37mPara quitar un host escriba \033[1;32mremoverhost\033[1;37m
Los hosts se encuentran en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i ubuntu 14 1> /dev/null 2> /dev/null ; then
echo -e "\033[1;37mConfigurando, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid3 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid3/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid3/squid.conf
payloads
service squid3 restart 1> /dev/null 2> /dev/null
addihost
removerhostf
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts, teclee \033[1;32maddhost
\033[1;37mPara para eliminar hosts teclee \033[1;32mremoverhost\033[1;37m
O eliminelos en el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mEl script ha sido instalado, cree un usuario de prueba\033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/so |grep -i centos 1> /dev/null 2> /dev/null ; then
echo -e "\033[01;37mConfigurando CentOS, Espere...\033[0m"
yum -y update 1> /dev/null 2> /dev/null
wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/f/figlet-2.2.5-9.el7.x86_64.rpm 1> /dev/null 2> /dev/null
rpm -Uvh figlet-2.2.5-9.el7.x86_64.rpm 1> /dev/null 2> /dev/null
yum install -y squid 1> /dev/null 2> /dev/null
yum install -y squid3 1> /dev/null 2> /dev/null
service httpd stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service sshd restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
payloads
service squid restart 1> /dev/null 2> /dev/null
addihost
removerhostf
echo -e "\033[1;37mPara agregar nuevos hosts teclee \033[1;32maddhost
\033[1;37mPara remover ejecute el comando \033[1;32mremoverhost\033[1;37m
O modifique el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado, cree un usuario de prueba\033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 6588, 8080 \033[0m"
exit
fi
if cat /etc/so |grep -i debian 1> /dev/null 2> /dev/null ; then
echo -e "\033[01;37mConfigurando, Espere...\033[0m"
apt-get update 1> /dev/null 2> /dev/null
apt-get install -y squid3 1> /dev/null 2> /dev/null
service apache2 stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service ssh restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid3/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid3/squid.conf
payloads
service squid3 restart 1> /dev/null 2> /dev/null
addihost
removerhostf
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts teclee \033[1;32maddhost
\033[1;37mPara remover ejecute el comandoo \033[1;32mremoverhost\033[1;37m
O modifique el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado, cree un usuario de prueba !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit 0
fi
if cat /etc/issue |grep -i kernel 1> /dev/null 2> /dev/null ; then
echo -e "\033[01;31mConfigurando, Espere...\033[0m"
yum -y update 1> /dev/null 2> /dev/null
yum install -y squid 1> /dev/null 2> /dev/null
service httpd stop 1> /dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service sshd restart 1> /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid/squid.conf
payloads
service squid restart 1> /dev/null 2> /dev/null
addihost
removerhostf
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts teclee \033[1;32maddhost
\033[1;37mPara remover execute el comando \033[1;32mremoverhost\033[1;37m
O mofifique el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado, cree un usuario de prueba !! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
exit
fi
echo -e "\033[01;31mConfigurando, Espere...\033[0m"
yum -y update 1> /dev/null 2> /dev/null
yum install -y squid 1> /dev/null 2> /dev/null
apt-get update > /dev/null 2> /dev/null
apt-get install -y squid3 > /dev/null 2>/dev/null
service httpd stop 1> /dev/null 2> /dev/null
service apache2 stop >/dev/null 2> /dev/null
chattr -i /etc/ssh/sshd_config > /dev/null 2> /dev/null
sshd_config
service sshd restart 1> /dev/null 2> /dev/null
service ssh restart > /dev/null 2> /dev/null
echo "
http_port 3128
http_port 6588
http_port 8080
visible_hostname VPSPack
acl ip dstdomain $ip
http_access allow ip" > /etc/squid*/squid.conf
echo 'acl accept dstdomain -i "/etc/payloads"
http_access allow accept
acl local dstdomain localhost
http_access allow local
acl iplocal dstdomain 127.0.0.1
http_access allow iplocal
http_access deny all' >> /etc/squid*/squid.conf
payloads
service squid restart 1> /dev/null 2> /dev/null
service squid3 restart > /dev/null 2> /dev/null
addihost
removerhostf
service ssh restart
echo -e "\033[1;37mPara agregar nuevos hosts teclee \033[1;32maddhost
\033[1;37mPara remover ejecute el comando \033[1;32mremoverhost\033[1;37m
O modifique el archivo /etc/payloads\033[0m"
echo -e "\033[01;31mFinalizado, cree un usuario de prueba!! \033[0m"
echo -e "\033[01;31mPuertos Agregados: \033[0m"
echo -e "\033[01;31mOpenSSH: 22 \033[0m"
echo -e "\033[01;31mSquid: 3128, 8080 \033[0m"
}
function sistemadetalhes(){
clear
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m ∆ Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m ∆ IP VPS: $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\n\033[1;30mProcessador\033[0m"
modelo=$(cat /proc/cpuinfo |grep "model name" |uniq |awk -F : {'print $2'})
cpucores=$(cat /proc/cpuinfo |grep "cpu cores" |uniq |awk -F : {'print $2'})
cache=$(cat /proc/cpuinfo |grep "cache size" |uniq |awk -F : {'print $2'})
echo -e "\033[1;32mModelo:\033[0m$modelo"
echo -e "\033[1;32mNucleos:\033[0m$cpucores"
echo -e "\033[1;32mMemoria Cache:\033[0m$cache"
echo -e "\033[1;32mArquitetura: \033[0m$(uname -a)"
echo -e "\n\033[1;30mSistema Operacional\033[0m"
name=$(cat /etc/os-release |grep PRETTY_NAME |awk -F = {'print $2'})
codename=$(cat /etc/os-release |grep NAME |awk -F = {'print $2'})
echo -e "\033[1;32mNombre: \033[0m$name"
echo -e "\033[1;32mCodeName: \033[0m$codename"
echo -e "\033[1;32mKernel: \033[0m$(uname -s)"
echo -e "\033[1;32mKernel Release: \033[0m$(uname -r)"
echo -e "\n\033[1;30mMemoria RAM\033[0m"
echo -e "\033[1;32mTotal: \033[0m$(free -m |grep -i mem |awk {'print $2'}) MB | $(( $(free -m |grep -i mem |awk {'print $2'}) / 1024 )) GB"
echo -e "\033[1;32mEn Uso: \033[0m$(free -m |grep -i mem |awk {'print $3'}) MB | $(( $(free -m |grep -i mem |awk {'print $3'}) / 1024 )) GB"
echo -e "\033[1;32mLibre: \033[0m$(free -m |grep -i mem |awk {'print $4'}) MB | $(( $(free -m |grep -i mem |awk {'print $4'}) / 1024 )) GB"
echo -e "\n\033[1;30mSwap\033[0m"
echo -e "\033[1;32mTotal: \033[0m$(free -m |grep -i swap |awk {'print $2'}) MB | $(( $(free -m |grep -i swap |awk {'print $2'}) / 1024 )) GB"
echo -e "\033[1;32mEn Uso: \033[0m$(free -m |grep -i swap |awk {'print $3'}) MB | $(( $(free -m |grep -i swap |awk {'print $3'}) / 1024 )) GB"
echo -e "\033[1;32mLibre: \033[0m$(free -m |grep -i swap |awk {'print $4'}) MB | $(( $(free -m |grep -i swap |awk {'print $4'}) / 1024 )) GB"
}
function monitorar(){
clear
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m ==================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m ==================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m ##############################\033[1;33m"
echo -e "\033[1;37m            ╼╼╼╼⌁⌁⌁◅⌁▻⌁⌁⌁╾╾╾╾   \033[0m"
echo -e " \033[47;30m   Usuario            :               Conexiones   \033[0m"
echo -e "\033[1;37m            -╼╼╼╼⌁⌁⌁◅⌁▻⌁⌁⌁╾╾╾╾  \033[0m"
for usur in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9] |sort`; do
if [ -f /etc/VpsPackdir/limite/$usur ]; then
limite=$(cat -n /etc/VpsPackdir/limite/$usur |awk '$1 = 1 {print $2}')
else
limite=null
fi
usurnum="$(ps -u $usur |grep sshd |wc -l)\033[1;30m/\033[1;33m$limite"
echo -e "\033[1;33m    $(printf '%-41s%s' $usur $usurnum) \033[0m"
echo -e "\033[1;37m             ╼╼╼╼⌁⌁⌁◅⌁▻⌁⌁⌁╾╾╾╾\033[0m"
done
}
function removerexpirados(){
clear
echo -e "         \033[1;33mRemover Usuarios Expirados\033[0m"
datahoje=$(date +%s)
for user in $(cat /etc/passwd |grep -v "nobody" |awk -F : '$3 > 900 {print $1}')
do
dataexp=$(chage -l $user |grep "Account expires" |awk -F : '{print $2}')
if [[ $dataexp == ' never' ]]; then
id > /dev/null 2>/dev/null
else
dataexpn=$(date -d"$dataexp" '+%d/%m/%Y')
dataexpnum=$(date '+%s' -d"$dataexp")
fi
if [[ $dataexpnum < $datahoje ]]; then
printf "\033[1;31m"
printf '%-41s' $user
printf "\033[0m"
echo "Usuario expirado eliminado"
kill $(ps -u $user |awk '{print $1}') >/dev/null 2>/dev/null ; userdel $user
else
printf "\033[1;32m"
printf '%-41s' $user
printf "\033[0m"
echo $dataexpn
fi
done
}
function criarusuarioteste(){
mkdir /etc/usuariosteste 1>/dev/null 2>/dev/null
echo -e "   Usuarios de prueba"
for testus in $(ls /etc/usuariosteste |sort |sed 's/.sh//g')
do
echo "$testus"
done
printf "\n"
printf "Nombre del usuario: "; read nome
printf "Contraseña del usuario: "; read pass
echo -e "\nUse s = segundos, m = minutos, h = horas e d = dias EX: 14s ."
printf "Cuanto tiempo la cuenta $nome debe durar: ";read tempoin
tempo=$(echo "$tempoin" |sed 's/ //g')
useradd -M -s /bin/false $nome
(echo $pass;echo $pass) |passwd $nome 1>/dev/null 2>/dev/null
echo "#!/bin/bash
sleep $tempo
kill"' $(ps -u '"$nome |awk '{print"' $1'"}') 1>/dev/null 2>/dev/null
userdel --force $nome
rm -rf /etc/usuariosteste/$nome.sh
exit" > /etc/usuariosteste/$nome.sh
echo -e "Usuario: $nome
Contraseña: $pass
Validez: $tempo\n
Despues de expirar, los usuarios seran desconectados."
bash /etc/usuariosteste/$nome.sh &
exit
}
function badvpn_install(){
wget --no-check-certificate https://www.dropbox.com/s/zk5hvrpwkkk2ps6/easyinstall && bash easyinstall && badvpn start
}
function removerlimite(){
echo -ne "\033[1;32mNombre del usuario a modificar: \033[0m"
read user
cronsemuser=$(cat /etc/crontab |grep -v "#$user#")
echo "$cronsemuser" > /etc/crontab
rm -rf /etc/VpsPackdir/limite/$user 2>/dev/null
rm -rf /etc/VpsPackdir/limite/$user.sh 2>/dev/null
pids=$(ps x |grep "#$user#" |awk {'print $1'})
kill $pids 2>/dev/null
kill "$pids" 2>/dev/null
kill -9 `ps x |grep "#$user#" |awk {'print $1'}` 2>/dev/null
kill `ps x |grep "#$user#" |awk {'print $1'}` 2>/dev/null
echo -e "\033[1;37mUsuario: $user, Limite removido\033[0m"
}
function backup_de_usuarios(){
clear
echo -e "\033[1;37mHaciendo respaldo de usuarios...\033[0m"
for user in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9]`
do
if [ -e /etc/VpsPackdir/senha/$user ]
then
pass=$(cat /etc/VpsPackdir/senha/$user)
else
echo -e "\033[1;31mNo fue posible obtener la contraseña del usuario\033[1;37m ($user)"
read -p "Digite un contraseña manualmente y Tecle ENTER: " pass
fi
if [ -e /etc/VpsPackdir/limite/$user ]
then
limite=$(cat /etc/VpsPackdir/limite/$user)
echo "$user:$pass:$limite" >> /etc/VpsPackdir/backup
echo -e "\033[1;37mRespaldo del usuario $user [\033[1;31mOK\033[1;37m]\033[0m"
else
echo "$user:$pass" >> /etc/VpsPackdir/backup
echo -e "\033[1;37mRespaldo del usuario $user [\033[1;31mOK\033[1;37m]\033[0m"
fi
done
echo " "
echo -e "\033[1;31mBackup Completo !!!\033[0m"
echo " "
echo -e "\033[1;37mLa informacion de los usuarios se encuentra en el archivo \033[1;31m /etc/VpsPackdir/backup \033[1;37m
Guardelo para futuras actualizaciones\033[0m"
}
function mudarnome(){
printf "Nombre que desea modificar: "; read user
if cat /etc/passwd |grep $user: >/dev/null 2>/dev/null
then
printf ""
else
echo "Usuario no existe"
exit
fi
printf "Nuevo nombre para el usuario $user: "; read nome
usermod -l $nome $user 1>/dev/null 2>/dev/null
echo -e "\nUsuario: $user, Nuevo nombre: $nome."
exit
}
function firewallblock(){
echo "Configurando Bloqueo de Torrents."
sleep 1
iptables -N LOGDROP > /dev/null 2> /dev/null && iptables -F LOGDROP && iptables -A LOGDROP -j LOG --log-prefix "LOGDROP" && iptables -A LOGDROP -j DROP && iptables -A FORWARD -m string --algo bm --string "BitTorrent" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string "BitTorrent protocol" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string "peer_id=" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string ".torrent" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string "announce.php?passkey=" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string "torrent" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string "announce" -j LOGDROP && iptables -A FORWARD -m string --algo bm --string "info_hash" -j LOGDROP && iptables -A FORWARD -m string --string "get_peers" --algo bm -j LOGDROP && iptables -A FORWARD -m string --string "announce_peer" --algo bm -j LOGDROP && iptables -A FORWARD -m string --string "find_node" --algo bm -j LOGDROP
iptables -A INPUT -m string --string "BitTorrent" --algo bm -j DROP && iptables -A INPUT -m string --string "BitTorrent protocol" --algo bm -j DROP && iptables -A INPUT -m string --string "peer_id=" --algo bm -j DROP && iptables -A INPUT -m string --string ".torrent" --algo bm -j DROP && iptables -A INPUT -m string --string "announce.php?passkey=" --algo bm -j DROP && iptables -A INPUT -m string --string "torrent" --algo bm -j DROP && iptables -A INPUT -m string --string "announce" --algo bm -j DROP && iptables -A INPUT -m string --string "info_hash" --algo bm -j DROP && iptables -A INPUT -m string --string "tracker" --algo bm -j DROP && iptables -A INPUT -m string --string "get_peers" --algo bm -j DROP && iptables -A INPUT -m string --string "announce_peer" --algo bm -j DROP && iptables -A INPUT -m string --string "find_node" --algo bm -j DROP
echo -e "\033[1;37mFirewall Basico [activado]\033[0m"
echo -e "\033[1;37mVerifique las reglas instaladas con el comando:\033[0m"
echo -e "\033[1;37miptables -L\033[0m"
}
function dropbear(){
cd /root
./dropbear
cd /root
}
function pl(){
cd /etc/VpsPackdir/
./pl.sh
cd /root
}
function resetfirewall(){
iptables -F
echo "Reglas FIREWALL Reseteadas"
vpspack
}
function puertos(){
clear
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;30m-----------------------------------------------------------\033[0m"
echo -e "\033[1;30m            Puertos Disponibles / En ejecucion                \033[0m"
echo -e "\033[1;30m-----------------------------------------------------------\033[0m"
netstat -tulpn | awk -vOFS='\t' '/^tcp/{print $4,$7} /^udp/{print $4,$6}' | grep "$filter"
}
function dnshost(){
clear
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m Escriba su Host\033[1;33m"
read -p ": " dnsx
cd /etc/VpsPackdir/
./d.sh "$dnsx"
cd /root/
}
function tools(){
clear
toolmaster
}
function drop(){
echo -e "\033[1;37m-------------------------------------------------------\033[0m"
echo -e "\033[42;30m USUARIO                :                 CONEXIONES \033[0m"
echo -e "\033[1;37m-------------------------------------------------------\033[0m"
for usur in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9]`; do
usurnum=$(ps -u $usur |grep dropbear |wc -l)
echo -e "\033[1;33m $(printf '%-42s%s' $usur $usurnum) \033[0m"
echo -e "\033[1;37m -------------------------------------------------------\033[0m"
done
echo -e "\033[1;31mPRESIONE ENTER\033[0m"
read -p " "
}
function cache(){
echo "Limpiando sistema y Reiniciando Servicios"
echo 3 > /proc/sys/vm/drop_caches 1> /dev/null 2> /dev/null
sysctl -w vm.drop_caches=3 1> /dev/null 2> /dev/null
swapoff -a && swapon -a 1> /dev/null 2> /dev/null
service ssh restart 1> /dev/null 2> /dev/null
service squid restart 1> /dev/null 2> /dev/null
service squid3 restart 1> /dev/null 2> /dev/null
echo "Limpieza Finalizada"
}
function autolimpieza(){
echo -e "Activando autolimpieza del Servidor"
echo -e "Todos los días a las 7 am se limpiará el Servidor automáticamente"
echo "00 07 * * * root /etc/VpsPackdir/limpieza.sh" >> /etc/crontab
/etc/init.d/cron restart
echo -e "Finalizando activacion"
}
function monitorx(){
htop
}
function fail2ban(){
echo "Instalando Fail2Ban ... Espere"
apt-get -y install fail2ban 1> /dev/null 2> /dev/null
service fail2ban restart 1> /dev/null 2> /dev/null
echo "Fail2Ban Instalado"
}
function stunnel(){
clear
echo "Instalando Stunnel"
bash /etc/VpsPackdir/ssl
vpspack
}
function webmin(){
echo "Instalando Webmin"
cd
wget --no-check-certificate -O webmin_1.900_all.deb "https://prdownloads.sourceforge.net/webadmin/webmin_1.900_all.deb"
dpkg -i --force-all webmin_1.900_all.deb;
apt-get -y -f install;
sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf
rm /root/webmin_1.900_all.deb
service webmin restart
echo "Panel Webmin Instalado en el Puerto: 10000"
echo "URL $ip:10000"
}
function dropbearuniversal(){
clear
echo "› Preparando Instalacion"
service dropbear stop 1> /dev/null 2> /dev/null
killall dropbear 1> /dev/null 2> /dev/null
apt-get -y purge dropbear 1> /dev/null 2> /dev/null
apt-get -y remove dropbear 1> /dev/null 2> /dev/null
echo "› Instalando Dropbear"
apt-get -y install dropbear 1> /dev/null 2> /dev/null
rm /etc/default/dropbear
cp /etc/VpsPackdir/confdropbear /etc/default/dropbear
echo -e "\033[1;31m › ESCRIBE UN PUERTO PARA DROPBEAR\033[0m"
echo -e "\033[1;31m › RECOMENDADO 443\033[0m"
read -p "› : " puertodropbear
sed -i '2i DROPBEAR_PORT="'"$puertodropbear"'"' /etc/default/dropbear
echo "/bin/false" >> /etc/shells
echo "/usr/sbin/nologin" >> /etc/shells
service dropbear restart 1> /dev/null 2> /dev/null
echo -e "\033[1;33m › INSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack 10
}
function dropbear14(){
clear
echo "› Preparando Instalacion"
service dropbear stop 1> /dev/null 2> /dev/null
killall dropbear 1> /dev/null 2> /dev/null
apt-get -y purge dropbear 1> /dev/null 2> /dev/null
apt-get -y remove dropbear 1> /dev/null 2> /dev/null
echo "› Instalando Dropbear"
apt-get -y install dropbear 1> /dev/null 2> /dev/null
rm /etc/default/dropbear
cp /etc/VpsPackdir/confdropbear /etc/default/dropbear
echo -e "\033[1;31m › ESCRIBE UN PUERTO PARA DROPBEAR\033[0m"
echo -e "\033[1;31m › RECOMENDADO 443\033[0m"
read -p "› : " puertodropbear
sed -i '2i DROPBEAR_PORT="'"$puertodropbear"'"' /etc/default/dropbear
echo "/bin/false" >> /etc/shells
echo "/usr/sbin/nologin" >> /etc/shells
service dropbear restart 1> /dev/null 2> /dev/null
echo -e "\033[1;33m › INSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack 10
}
function dropbear16(){
clear
echo "› Preparando Instalacion"
service dropbear stop 1> /dev/null 2> /dev/null
killall dropbear 1> /dev/null 2> /dev/null
apt-get -y purge dropbear 1> /dev/null 2> /dev/null
apt-get -y remove dropbear 1> /dev/null 2> /dev/null
echo "› Instalando Dropbear"
apt-get -y install dropbear=2016.72-1 1> /dev/null 2> /dev/null
rm /etc/default/dropbear
cp /etc/VpsPackdir/confdropbear /etc/default/dropbear
echo -e "\033[1;31m › ESCRIBE UN PUERTO PARA DROPBEAR\033[0m"
echo -e "\033[1;31m › RECOMENDADO 443\033[0m"
read -p "› : " puertodropbear
sed -i '2i DROPBEAR_PORT="'"$puertodropbear"'"' /etc/default/dropbear
echo "/bin/false" >> /etc/shells
echo "/usr/sbin/nologin" >> /etc/shells
service dropbear restart 1> /dev/null 2> /dev/null
echo -e "\033[1;33m › INSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack 10
}
function dropbeardebian9(){
clear
echo "Instalando Dropbear"
apt-get -y purge dropbear 1> /dev/null 2> /dev/null
apt-get -y install dropbear=2016.74-5
clear
sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=443/g' /etc/default/dropbear
echo "/bin/false" >> /etc/shells
echo "/usr/sbin/nologin" >> /etc/shells
service dropbear restart 1> /dev/null 2> /dev/null
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack 10
}
function dropbearcentos(){
clear
echo "Instalando Dropbear"
yum -y remove dropbear 1> /dev/null 2> /dev/null
wget http://ftp-stud.hs-esslingen.de/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 1> /dev/null 2> /dev/null
rpm -Uvh epel-release-6-8.noarch.rpm 1> /dev/null 2> /dev/null
yum -y install dropbear
mkdir /etc/sysconfig
wget --no-check-certificate https://www.dropbox.com/s/lk9f2cbiois00bt/dropbear > /etc/sysconfig/dropbear
service dropbear restart 1> /dev/null 2> /dev/null
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack 10
}
function installdropbear(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m - INSTALADOR DROPBEAR - \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione su Sistema:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] Ubuntu 14 \033[1;33m
[\033[1;30m2\033[1;33m] Ubuntu 16 \033[1;33m
[\033[1;30m3\033[1;33m] Ubuntu 17 \033[1;33m
[\033[1;30m4\033[1;33m] Ubuntu 18 \033[1;33m
[\033[1;30m5\033[1;33m] Ubuntu 19 \033[1;33m
[\033[1;30m6\033[1;33m] Debian 8 \033[1;33m
[\033[1;30m7\033[1;33m] Debian 9 \033[1;33m
[\033[1;30m8\033[1;33m] CentOS \033[1;33m
[\033[1;30m9\033[1;33m] Universal \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
dropbear14;;
2)
dropbear16;;
3)
dropbear16;;
4)
dropbearuniversal;;
5)
dropbearuniversal;;
6)
dropbearuniversal;;
7)
dropbeardebian9;;
8)
dropbearcentos;;
9)
dropbearuniversal;;
0)
vpspack;;
esac
}
info(){
clear
echo "VPSPack $vpspackversion"
echo "##################################################"
echo "# Sistemas Instalados                            #"
echo "#                                                #"
echo "# OpenSSH     22                                 #"
echo "# Dropbear    443                                #"
echo "# Stunnel     442>22                             #"
echo "# Squid       3128 , 80, 8080                    #"
echo "# Python      4443                               #"
echo "# Shadowsocks 1080, 8388                         #"
echo "# OpenVPN     1194                               #"
echo "# Fail2Ban                                       #"
echo "# Webmin      10000                              #"
echo "# Ngix        81                                 #"
echo "# Netdata     19999                              #"
echo "# Darkstat    666 | 667                          #"
echo "#                                                #"
echo "#              -Extras-                          #"
echo "# Herramientas:                                  #"
echo "# DNS LookUp                                     #"
echo "# Whois Lookup                                   #"
echo "# Reverse IP                                     #"
echo "# GeoIP                                          #"
echo "# Subnet Lookup                                  #"
echo "# Port Scanner                                   #"
echo "# Extract Links                                  #"
echo "# Zone Transfer                                  #"
echo "# HTTP Header                                    #"
echo "# Host Finder                                    #"
echo "# TCP Speed                                      #"
echo "##################################################"
echo "# By: @Thony_DroidYT                             #"
echo "# Sitio Web: bit.ly/thonyblog                    #"
echo "# CCGen Web: bit.ly/td-ccgen                     #"
echo "# YouTube. : THONY.DROID 2.0                     #"
echo "##################################################"
echo -e "\033[1;31mPRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function herramientas(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ HERRAMIENTAS \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m]   SCANNER \033[1;33m
[\033[1;30m2\033[1;33m]   BUSCADOR DE HOST / DNS \033[1;33m
[\033[1;30m3\033[1;33m]   GENERADOR DE PAYLOADS \033[1;33m
[\033[1;30m4\033[1;33m]   LIMPIAR CACHE \033[1;33m
[\033[1;30m5\033[1;33m]   MONITOR DE CPU \033[1;33m
[\033[1;30m6\033[1;33m]   ADMINISTRADOR DE PROCESOS \033[1;33m
[\033[1;30m7\033[1;33m]   BADVPN ALTERNO (EXPERIMENTAL) \033[1;33m
[\033[1;30m8\033[1;33m]   NODEJS & NPM (EXPERIMENTAL) \033[1;33m
[\033[1;30m9\033[1;33m]   REDIRECCIONADOR SSL \033[1;33m
[\033[1;30m10\033[1;33m]  SOPORTE TLS 1.3 (EXPERIMENTAL)\033[1;33m
[\033[1;30m11\033[1;33m]  AUTOLIMPIEZA\033[1;33m
[\033[1;30m12\033[1;33m]  FIX PASSWORD (vultr)\033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
tools;;
2)
dnshost;;
3)
pl;;
4)
cache;;
5)
monitorx;;
6)
administradorprocesos;;
7)
badvpnalterno;;
8)
nodejs;;
9)
redirssl;;
10)
tls13;;
11)
autolimpieza;;
12)
fixvultr;;
0)
vpspack;;
esac
}
function fixvultr(){
echo -e "Añadiendo Registro a PAM.D"
sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password
echo -e "Registro agregado"
sleep 6
vpspack
}
function tls13(){
apt-get install -y git autoconf libtool
git clone https://github.com/wolfssl/wolfssl.git
cd wolfssl/
./autogen.sh
./configure --enable-sha512
make
make install
ldconfig
./configure --enable-stunnel --enable-tls13
make
make install
ldconfig
service stunnel4 restart
cd /root
}
function redirssl(){
echo -e "Escriba un nombre para el Redireccionador SSL"
read -p ": " nombressl
echo -e "Escriba el puerto del Servicio a enlazar"
read -p ": " portserv
echo -e "Escriba el Nuevo Puerto SSL"
read -p ": " portssl
if lsof -Pi :$portssl -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
echo "[$nombressl] " >> /etc/stunnel/stunnel.conf
echo "cert = /etc/stunnel/stunnel.pem " >> /etc/stunnel/stunnel.conf
echo "accept = $portssl " >> /etc/stunnel/stunnel.conf
echo "connect = 127.0.0.1:$portserv" >> /etc/stunnel/stunnel.conf
sleep 5
echo "Reiniciando Servicio : Stunnel4"
service stunnel4 restart 1> /dev/null 2> /dev/null
sleep 5
vpspack
fi
}
function nodejs(){
echo -e "Instalando NodeJS & NPM"
apt-get install nodejs -y && apt-get install npm -y 1> /dev/null 2> /dev/null
echo -e "Instalacion Finalizada"
}
function badvpnalterno(){
clear
echo "Instalando BADVPN Alterno"
wget --no-check-certificate https://www.dropbox.com/s/fd8paht2i76kang/install && bash install
}
function python(){
clear
apt-get -y install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
apt-get -y install screen
apt-get -y install python3-pip
apt-get -y install python
apt-get -y install lsof
apt-get -y install bc
apt-get -y install unzip
screen -dmS prox python proxy.py
}
function shadowsocks(){
clear
cd /etc/VpsPackdir/ && chmod +x shadowsocks.sh && ./shadowsocks.sh 2>&1 | tee shadowsocks.log && cd /root
}
function openvpn(){
clear
cd /etc/VpsPackdir/ && bash openvpn-install.sh && cd /root
}
function actualizar(){
cd /etc/VpsPackdir/v/ && bash version.sh && cd /root
}
firewallon (){
read -p "Escriba su IP: " -e -i $1 ip
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
echo Configurando FIREWALL...
sleep 1
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -d $ip --dport 443 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp -d $ip --dport 80 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p tcp --dport 67 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --dport 67 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 3128 -j ACCEPT
iptables -A INPUT -p tcp --dport 8799 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 8080 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 3128 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 8799 -j ACCEPT
iptables -A FORWARD -p tcp --dport 8080 -j ACCEPT
iptables -A FORWARD -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -p tcp --dport 3128 -j ACCEPT
iptables -A FORWARD -p tcp --dport 8799 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 10000 -j ACCEPT
echo -e "\033[1;36mFirewall modificado
Puertos Modificados - 443 22 8799 8080 80 3128
Bloqueo - ICMP
Bloqueo - Torrent
Proteccion Low Mode DDoS
\033[0m"
touch /etc/VpsPackdir/firewall
exit
}
function nginx(){
echo "Desinstalando nginx"
apt-get remove nginx
echo "Instalando nginx"
apt-get -y install nginx
rm /etc/nginx/sites-enabled/default
rm /etc/nginx/sites-available/default
wget --no-check-certificate -O /etc/nginx/nginx.conf "https://raw.githubusercontent.com/powermx/autoscript/master/nginx.conf"
mkdir -p /home/vps/public_html
echo "<pre>1 + 1 = 2</pre>" > /home/vps/public_html/index.html
wget --no-check-certificate -O /etc/nginx/conf.d/vps.conf "https://raw.githubusercontent.com/powermx/autoscript/master/vps.conf"
service nginx restart
echo "Instalacion Finalizada"
echo "Verfique la instalacion accesando a $ip:81"
echo "La carpeta de archivos se encuentra en la siguiente ruta:"
echo "/home/vps/public_html"
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
read -p " "
vpspack 10
}
function libs32(){
dpkg --add-architecture i386
apt-get update
apt-get install libc6:i386 libstdc++6:i386
clear
echo -e "\033[1;31mLIBRERIAS INSTALADAS, PRESIONE ENTER\033[0m"
read -p " "
vpspack 10
}
function fix(){
echo "Removiendo paquetes (Ajustes)"
apt-get -y remove squid3 1> /dev/null 2> /dev/null
apt-get -y purge squid3 1> /dev/null 2> /dev/null
apt-get -y remove dropbear 1> /dev/null 2> /dev/null
apt-get -y purge dropbear 1> /dev/null 2> /dev/null
echo "Finalizado"
vpspack 1
}
function monitores(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ MONITOR\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] OPENSSH \033[1;30m(Puerto [\033[1;31m22\033[1;30m])\033[1;33m
[\033[1;30m2\033[1;33m] DROPBEAR \033[1;30m(Puerto [\033[1;31m443\033[1;30m])\033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
monitorar;;
2)
dropbear;;
esac
}
function administradorprocesos(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ ADMINISTRADOR PROCESOS\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] ENCENDER \033[1;30m([\033[1;31mINICIAR PROCESOS\033[1;30m])\033[1;33m
[\033[1;30m2\033[1;33m] DETENER \033[1;30m([\033[1;31mDETENER PROCESOS\033[1;30m])\033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
encender;;
2)
detener;;
0)
vpspack;;
esac
}
function encender(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] SSH \033[1;30m(Inicia OpenSSH [\033[1;31mRIESGO\033[1;30m])\033[1;33m
[\033[1;30m2\033[1;33m] DROPBEAR \033[1;30m(Inicia Dropbear)\033[1;33m
[\033[1;30m3\033[1;33m] SQUID \033[1;30m(Inicia Squid)\033[1;33m
[\033[1;30m4\033[1;33m] PYTHON \033[1;30m(Inicia Python)\033[1;33m
[\033[1;30m5\033[1;33m] SSL \033[1;30m(Inicia SSL)\033[1;33m
[\033[1;30m6\033[1;33m] APACHE \033[1;30m(Inicia Apache)\033[1;33m
[\033[1;30m7\033[1;33m] SHADOWSOCKS \033[1;30m(Inicia Shadowsocks)\033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
encenderssh;;
2)
encenderdropbear;;
3)
encendersquid;;
4)
encenderpython;;
5)
encenderssl;;
6)
encenderapache;;
7)
encendershadow;;
0)
vpspack;;
esac
}
function encenderssh(){
service ssh start > /dev/null 2> /dev/null
echo "Servicio Iniciado"
sleep 3
vpspack
}
function encenderdropbear(){
service dropbear start > /dev/null 2> /dev/null
echo "Servicio Iniciado"
sleep 3
vpspack
}
function encendersquid(){
service squid start && service squid3 start > /dev/null 2> /dev/null
echo "Servicio Iniciado"
sleep 3
vpspack
}
function encenderpython(){
screen python proxy.py > /dev/null 2> /dev/null
echo "Servicio Iniciado"
sleep 3
vpspack
}
function encenderssl(){
service stunnel4 start > /dev/null 2> /dev/null
echo "Servicio Iniciado"
sleep 3
vpspack
}
function encenderapache(){
service apache2 start > /dev/null 2> /dev/null
echo "Servicio iniciado"
sleep 3
vpspack
}
function encendershadow(){
/etc/init.d/shadowsocks-python start > /dev/null 2> /dev/null
echo "Servicio iniciado"
sleep 3
vpspack
}
function detener(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] SSH \033[1;30m(Detiene OpenSSH [\033[1;31mRIESGO\033[1;30m])\033[1;33m
[\033[1;30m2\033[1;33m] DROPBEAR \033[1;30m(Detiene Dropbear)\033[1;33m
[\033[1;30m3\033[1;33m] SQUID \033[1;30m(Detiene Squid)\033[1;33m
[\033[1;30m4\033[1;33m] PYTHON \033[1;30m(Detiene Python)\033[1;33m
[\033[1;30m5\033[1;33m] SSL \033[1;30m(Detiene SSL)\033[1;33m
[\033[1;30m6\033[1;33m] APACHE \033[1;30m(Detiene Apache)\033[1;33m
[\033[1;30m7\033[1;33m] SHADOWSOCKS \033[1;30m(Detiene Shadowsocks)\033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
detenerssh;;
2)
detenerdropbear;;
3)
detenersquid;;
4)
detenerpython;;
5)
detenerssl;;
6)
detenerapache;;
7)
detenershadow;;
0)
vpspack;;
esac
}
function detenerssh(){
service ssh stop > /dev/null 2> /dev/null
echo "Servicio Detenido"
sleep 3
vpspack
}
function detenerdropbear(){
service dropbear stop > /dev/null 2> /dev/null
killall dropbear
echo "Servicio Detenido"
sleep 3
vpspack
}
function detenersquid(){
service squid stop && service squid3 stop > /dev/null 2> /dev/null
echo "Servicio Detenido"
sleep 3
vpspack
}
function detenerpython(){
pkill python && killall python > /dev/null 2> /dev/null
echo "Servicio Detenido"
sleep 3
vpspack
}
function detenerssl(){
service stunnel4 stop > /dev/null 2> /dev/null
echo "Servicio Detenido"
sleep 3
vpspack
}
function detenerapache(){
service apache2 stop > /dev/null 2> /dev/null
echo "Servicio Detenido"
sleep 3
vpspack
}
function detenershadow(){
/etc/init.d/shadowsocks-libev stop > /dev/null 2> /dev/null
/etc/init.d/shadowsocks stop > /dev/null 2> /dev/null
/etc/init.d/shadowsocks-r stop > /dev/null 2> /dev/null
echo "Servicios Detenidos"
sleep 3
vpspack
}
function estadisticas(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ ESTADISTICAS \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m Estos paquetes consumen grandes cantidades de datos\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m Se recomienda instalar en VPS con servicio Unmetered\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] DARKSTAT \033[1;33m
[\033[1;30m2\033[1;33m] NETDATA \033[1;33m
[\033[1;30m3\033[1;33m] GLANCES \033[1;33m
[\033[1;30m4\033[1;33m] VNSTAT \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
darkstat;;
2)
netdata;;
3)
glances;;
4)
vnstat;;
0)
vpspack;;
esac
}
function addport(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ Agregar Puerto \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m Escoja el servicio para agregarle un puerto\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] SSH \033[1;33m
[\033[1;30m2\033[1;33m] DROPBEAR \033[1;33m
[\033[1;30m3\033[1;33m] SQUID \033[1;33m
[\033[1;30m4\033[1;33m] SSL \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
addportssh;;
2)
addportdrop;;
3)
addportsquid;;
4)
addportssl;;
0)
vpspack;;
esac
}
function addportssh(){
echo "Nuevo Puerto a Agregar:"
read -p ": " portssh
if lsof -Pi :$portssh -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
sed -i "5i Port $portssh" /etc/ssh/sshd_config
sleep 10
echo "Reiniciando OpenSSH para ejecutar cambios"
service ssh restart
sleep 10
vpspack
fi
}
function addportdrop(){
echo "Nuevo Puerto a Agregar:"
read -p ": " portdrop
if lsof -Pi :$portdrop -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
sed -i "8d" /etc/default/dropbear
sed -i '8i DROPBEAR_EXTRA_ARGS="-p '"$portdrop"'"' /etc/default/dropbear
sleep 10
echo "Reiniciando Dropbear para ejecutar cambios"
service dropbear restart
sleep 10
vpspack
fi
}
function addportsquid(){
echo "Nuevo Puerto a Agregar:"
read -p ": " portsquid
if lsof -Pi :$portsquid -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
sed -i "1i http_port $portsquid" /etc/squid3/squid.conf 1> /dev/null 2> /dev/null
sed -i "1i http_port $portsquid" /etc/squid/squid.conf 1> /dev/null 2> /dev/null
sleep 5
echo "Reiniciando Servicio : Squid"
service squid restart 1> /dev/null 2> /dev/null
service squid3 restart 1> /dev/null 2> /dev/null
sleep 5
vpspack
fi
}
function addportssl(){
echo -e "Escriba el Puerto a Utilizar"
read -p ": " portssl
if lsof -Pi :$portssl -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
rm /etc/stunnel/stunnel.conf
echo "client = no " >> /etc/stunnel/stunnel.conf
echo "[ssh] " >> /etc/stunnel/stunnel.conf
echo "cert = /etc/stunnel/stunnel.pem " >> /etc/stunnel/stunnel.conf
echo "accept = $portssl " >> /etc/stunnel/stunnel.conf
echo "connect = 127.0.0.1:22" >> /etc/stunnel/stunnel.conf
sleep 5
echo "Reiniciando Servicio : Stunnel4"
service stunnel4 restart 1> /dev/null 2> /dev/null
sleep 5
vpspack
fi
}
function darkstat(){
clear
echo "Instalando DarkStat"
apt-get install -y darkstat 1> /dev/null 2> /dev/null
echo "Iniciando DarkStat en puerto 666"
darkstat -i eth0 -p 666
echo "Instalacion Finalizada"
vpspack 10
}
function netdata(){
clear
echo "Instalando NetData"
apt-get install -y zlib1g-dev uuid-dev libmnl-dev gcc make autoconf autoconf-archive autogen automake pkg-config curl 1> /dev/null 2> /dev/null
apt-get install -y python python-yaml python-mysqldb python-psycopg2 nodejs lm-sensors netcat 1> /dev/null 2> /dev/null
git clone https://github.com/firehol/netdata.git --depth=1 ~/netdata
cd ~/netdata
./netdata-installer.sh
cd /root
echo "Instalacion Finalizada"
echo "Estadisticas de Netdata instaladas en puerto: 19999"
echo "http://your_server_ip:19999"
}
function glances(){
clear
echo "Instalando Glances"
apt-get install -y glances 1> /dev/null 2> /dev/null
echo "Instalacion Finalizada"
echo "Para iniciar las estadisticas con Glances escriba : glances"
}
function vnstat(){
clear
echo "Instalando Vnstat"
apt-get install -y vnstat 1> /dev/null 2> /dev/null
echo "Instalacion Finalizada"
echo "Para iniciar las estadisticas con Glances escriba : vnstat"
}
function gestionusuarios(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m - GESTION DE USUARIOS -\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m]  LIMITE DE CONEXIONES\033[1;33m
[\033[1;30m2\033[1;33m]  CREAR USUARIO\033[1;33m
[\033[1;30m3\033[1;33m]  REMOVER USUARIOS EXPIRADOS\033[1;33m
[\033[1;30m4\033[1;33m]  CREAR USUARIO DE PRUEBA\033[1;33m
[\033[1;30m5\033[1;33m]  REMOVER LIMITE DE CONEXIONES\033[1;33m
[\033[1;30m6\033[1;33m]  MODIFICAR NOMBRE DE USUARIO \033[1;33m
[\033[1;30m7\033[1;33m]  MODIFICAR USUARIO\033[1;33m
[\033[1;30m8\033[1;33m]  ELIMINAR USUARIO\033[1;33m
[\033[1;30m9\033[1;33m]  MONITOR USUARIOS\033[1;33m
[\033[1;30m10\033[1;33m] RESPALDO DE USUARIO\033[1;33m
[\033[1;30m11\033[1;33m] RESTAURAR USUARIOS\033[1;33m
[\033[1;30m12\033[1;33m] DETALLE DE USUARIOS\033[1;33m
[\033[1;30m13\033[1;33m] ELIMINAR TODOS LOS USUARIOS\033[1;33m
[\033[1;30m14\033[1;33m] LIMITAR CONEXIONES SHADOWSOCKS (EXPERIMENTAL)\033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1 | 01 )
read -p "Usuario: " user
read -p "Limite: " limite
limite $user $limite;;
2 | 02 )
criarusuario;;
3 | 03 )
removerexpirados;;
4 | 04 )
criarusuarioteste;;
5 | 05 )
removerlimite;;
6 | 06 )
mudarnome;;
7 | 07 )
redefinirusuario;;
8 | 08 )
deletarusuario;;
9 | 09)
monitores;;
10)
backup_de_usuarios;;
11)
restaurar_usuarios;;
12)
detalhes_usuarios;;
13)
deletar_todos;;
14)
limitarshadowsocks;;
0)
vpspack;;
esac
}
function limitarshadowsocks(){
echo "Escribe el puerto Shadowsocks en uso"
read -p ": " shadowpuerto
echo "Escribe el numero de usuarios que quieres limitar Shadowsocks: "
read -p ": " shadowlimit
iptables -A INPUT -p tcp --syn --dport $shadowpuerto -m connlimit --connlimit-above $shadowlimit -j REJECT --reject-with tcp-reset
echo "Se agregó la regla de limite de $shadowlimit en el puerto $shadowpuerto en Shadowsocks"
}
function delpaq(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ DESINSTALADOR \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion a desinstalar:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] BADVPN \033[1;33m
[\033[1;30m2\033[1;33m] FAIL2BAN \033[1;33m
[\033[1;30m3\033[1;33m] STUNNEL4 \033[1;33m
[\033[1;30m4\033[1;33m] WEBMIN \033[1;33m
[\033[1;30m5\033[1;33m] PYTHON \033[1;33m
[\033[1;30m6\033[1;33m] SHADOWSOCKS \033[1;33m
[\033[1;30m7\033[1;33m] DROPBEAR \033[1;33m
[\033[1;30m8\033[1;33m] OPENVPN \033[1;33m
[\033[1;30m9\033[1;33m] LIBRERIAS 32BITS \033[1;33m
[\033[1;30m10\033[1;33m] NGINX \033[1;33m
[\033[1;30m11\033[1;33m] SQUID \033[1;33m
[\033[1;30m12\033[1;33m] V2RAY \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
removerbadvpn;;
2)
removerfail2ban;;
3)
removerstunnel;;
4)
removerwebmin;;
5)
removerpython;;
6)
removershadowsocks;;
7)
removerdropbear;;
8)
removeropenvpn;;
9)
removerlibs32;;
10)
removernginx;;
11)
removersquid;;
12)
removerv2ray;;
0)
vpspack;;
esac
}
function removerv2ray(){
source <(curl -sL https://git.io/fNgqx) --remove
vpspack
}
function removerbadvpn(){
badvpn stop
killall badvpn-udpgw
rm /bin/badvpn
rm /usr/bin/badvpn-udpgw
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removerfail2ban(){
apt-get purge fail2ban -y
apt-get remove fail2ban -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removerstunnel(){
apt-get purge stunnel4 -y
apt-get remove stunnel4 -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removerwebmin(){
apt-get purge webmin -y
apt-get remove webmin -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removerpython(){
killall python
pkill python
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removershadowsocks(){
cd /etc/VpsPackdir/
./shadowsocks.sh uninstall
cd /root
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removerdropbear(){
service dropbear stop
apt-get purge dropbear -y
apt-get remove dropbear -y
service dropbear stop
/etc/init.d/dropbear stop
killall dropbear
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removeropenvpn(){
apt-get purge openvpn -y
apt-get remove openvpn -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removerlibs32(){
apt-get purge ia32-libs -y
apt-get remove ia32-libs -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removernginx(){
apt-get purge nginx -y
apt-get remove nginx -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function removersquid(){
apt-get purge squid -y
apt-get remove squid -y
apt-get purge squid3 -y
apt-get remove squid3 -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
vpspack
}
function config(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ CONFIGURACIONES \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] SSH                 ›   \033[1;32m$xssh \033[1;33m
[\033[1;30m2\033[1;33m] DROPBEAR            ›   \033[1;32m$xdropbear\033[1;33m
[\033[1;30m3\033[1;33m] STUNNEL4            ›   \033[1;32m$xstunnel \033[1;33m
[\033[1;30m4\033[1;33m] SQUID               ›   \033[1;32m$xsquid \033[1;33m
[\033[1;30m5\033[1;33m] PROXY PYTHON        ›   \033[1;32m$xpython \033[1;33m
[\033[1;30m6\033[1;33m] SHADOWSOCKS         ››  \033[1;33m
[\033[1;30m7\033[1;33m] SOCKS5              ›   \033[1;32m$xsocks5 \033[1;33m
[\033[1;30m8\033[1;33m] SOCKD               ›   \033[1;32m$xsocksd \033[1;33m
[\033[1;30m9\033[1;33m] OPENVPN             ›   \033[1;32m$xopenvpn \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
configssh;;
2)
configdropbear;;
3)
configstunnel;;
4)
configsquid;;
5)
configproxy;;
6)
configshadow;;
7)
configsocks5;;
8)
configsockd;;
9)
configopenvpn;;
0)
vpspack;;
esac
}
function configssh(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion SSH\033[0m"
cat /etc/ssh/sshd_config
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configdropbear(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Dropbear\033[0m"
echo -e "\033[1;37m › /etc/default/dropbear\033[0m"
cat /etc/default/dropbear
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configstunnel(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Stunnel\033[0m"
echo -e "\033[1;37m › /etc/stunnel/stunnel.conf\033[0m"
cat /etc/stunnel/stunnel.conf
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configsquid(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Squid\033[0m"
cat /etc/squid/squid.conf
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configproxy(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Proxy Python\033[0m"
echo -e "\033[1;37m › /root/proxy.py\033[0m"
cat /root/proxy.py
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configsocks5(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Socks5\033[0m"
echo -e "\033[1;37m › /etc/danted.conf\033[0m"
cat /etc/danted.conf
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configsockd(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Sockd\033[0m"
echo -e "\033[1;37m › /home/dante/danted.conf\033[0m"
cat /home/dante/danted.conf
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configopenvpn(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Openvpn\033[0m"
echo -e "\033[1;37m › /etc/openvpn/server.conf\033[0m"
cat /etc/openvpn/server.conf
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configshadow(){
if [[ $1 == "" ]]
then
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Shadowsocks\033[0m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] LIBEV                 ›   \033[1;33m
[\033[1;30m2\033[1;33m] ROCKET                ›   \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
configlibev;;
2)
configrocket;;
0)
vpspack;;
esac
}
function configlibev(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Shadowsocks Libev\033[0m"
echo -e "\033[1;37m › /etc/shadowsocks-libev/config.json\033[0m"
cat /etc/shadowsocks-libev/config.json
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function configrocket(){
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Configuracion Shadowsocks Rocket\033[0m"
echo -e "\033[1;37m › /etc/shadowsocks-r/config.json\033[0m"
cat /etc/shadowsocks-r/config.json
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
}
function extras(){
clear
if [[ $1 == "" ]]
then
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m       VPSPack $vpspackversion @ INSTALADORES EXTRAS \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] BADVPN                 ›   \033[1;32m$xbadvpn \033[1;33m
[\033[1;30m2\033[1;33m] FAIL2BAN               ›   \033[1;33m
[\033[1;30m3\033[1;33m] STUNNEL4               ›   \033[1;32m$xstunnel \033[1;33m
[\033[1;30m4\033[1;33m] WEBMIN                 ›   \033[1;32m$xwebmin \033[1;33m
[\033[1;30m5\033[1;33m] PYTHON                 ›   \033[1;32m$xpython \033[1;33m
[\033[1;30m6\033[1;33m] SHADOWSOCKS            ›   \033[1;32m$xshadowsocks \033[1;33m
[\033[1;30m7\033[1;33m] DROPBEAR               ›   \033[1;32m$xdropbear \033[1;33m
[\033[1;30m8\033[1;33m] OPENVPN                ›   \033[1;32m$xopenvpn \033[1;33m
[\033[1;30m9\033[1;33m] NGINX (REINSTALL)      ›   \033[1;32m$xnginx \033[1;33m
[\033[1;30m10\033[1;33m] LIBRERIAS 32BITS      ›    \033[1;33m
[\033[1;30m11\033[1;33m] ESTADISTICAS          ››   \033[1;33m
[\033[1;30m12\033[1;33m] OPENVPN Web Panel 16  ›   \033[1;33m
[\033[1;30m13\033[1;33m] OPENVPN Web Panel 18  ›   \033[1;33m
[\033[1;30m14\033[1;33m] SOCKS5                ›   \033[1;32m$xsocks5 \033[1;33m
[\033[1;30m15\033[1;33m] SOCKS5 (Sockd)        ›   \033[1;32m$xsockd \033[1;33m
[\033[1;30m16\033[1;33m] SOCKS5 (Microsocks)   ›   \033[1;32m$xmicro \033[1;33m
[\033[1;30m17\033[1;33m] DNS Server            ›   \033[1;32m$xdns \033[1;33m
[\033[1;30m18\033[1;33m] V2RAY                 ›   \033[1;32m$xv2ray \033[1;33m
[\033[1;30m19\033[1;33m] CLOAK                 ›   \033[1;32m$xcloak \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
badvpn_install;;
2)
fail2ban;;
3)
stunnel;;
4)
webmin;;
5)
python;;
6)
shadowsocks;;
7)
installdropbear;;
8)
openvpn;;
9)
nginx;;
10)
libs32;;
11)
estadisticas;;
12)
openvpnweb16;;
13)
openvpnweb18;;
14)
socks5;;
15)
socks5alter;;
16)
microsocks;;
17)
dnsserver;;
18)
v2rayins;;
19)
cloakins;;
0)
vpspack;;
esac
}
function cloakins(){
curl -o Shadowsocks-Cloak-Installer.sh -L https://www.dropbox.com/s/yvwllu0c8p1z16s/Shadowsocks-Cloak-Installer.sh && bash Shadowsocks-Cloak-Installer.sh && rm Shadowsocks-Cloak-Installer.sh
}
function v2rayins(){
source <(curl -sL https://git.io/fNgqx)
}
function dnsserver(){
echo -e "Instalando DNS Server"
curl -sSL https://download.technitium.com/dns/install-ubuntu.sh | bash 1> /dev/null 2> /dev/null
echo -e "Actualizando DNS del Servidor"
echo -e "DNS Server Instalado"
echo -e "Consola Web DNS Server: http://'$MYIP':5380/"
echo -e "No olvide establecer su password admin del Panel"
}
function microsocks (){
killall microsocks
echo -e "Instalando Microsocks espere.."
cd /etc/VpsPackdir/
rm -rf /etc/VpsPackdir/microsocks/ 1> /dev/null 2> /dev/null
git clone http://github.com/rofl0r/microsocks.git 1> /dev/null 2> /dev/null
cd /etc/VpsPackdir/microsocks/
make 1> /dev/null 2> /dev/null
make install 1> /dev/null 2> /dev/null
cd /root
echo -e "⎇⇥ Escriba un nombre de usuario nuevo"
read -p ": " microuser
useradd --shell /usr/sbin/nologin $microuser
echo -e "⎇⇥ Asigna un password para la cuenta microsocks, repitelo dos veces"
passwd $microuser
echo -e "⎇⇥ Escribe el mismo password asignado nuevamente"
read -p ": " clavemicro
echo -e "⎇⇥ Escribe un puerto libre para Microsocks"
read -p ": " puertomicro
if lsof -Pi :$puertomicro -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
screen -dmS micro microsocks -1 -i 0.0.0.0 -p $puertomicro -u $microuser -P $clavemicro -b bindaddr
echo -e "╼╼╼╼⌁⌁⌁◅⌁▻⌁⌁⌁╾╾╾╾"
echo -e "⌬ Servidor Socks5 [ microsocks ] iniciado"
echo -e "⌁ IP : $MYIP"
echo -e "⌁ Puerto : $puertomicro"
echo -e "⌁ Usuario : $microuser"
echo -e "⌁ Password : $clavemicro"
fi
}
function socks5alter(){
echo -e "Instalando Sockd espere..."
cd /etc/VpsPackdir/ 1> /dev/null 2> /dev/null
rm /etc/VpsPackdir/dante-1.4.1.tar.gz 1> /dev/null 2> /dev/null
wget --no-check-certificate https://www.inet.no/dante/files/dante-1.4.1.tar.gz 1> /dev/null 2> /dev/null
tar -zxvf dante-1.4.1.tar.gz 1> /dev/null 2> /dev/null
cd /etc/VpsPackdir/dante-1.4.1/ 1> /dev/null 2> /dev/null
mkdir /home/dante 1> /dev/null 2> /dev/null
./configure --prefix=/home/dante 1> /dev/null 2> /dev/null
make 1> /dev/null 2> /dev/null
make install 1> /dev/null 2> /dev/null
wget -O /home/dante/danted.conf https://www.dropbox.com/s/fn2f2useeeh52vo/dante.txt 1> /dev/null 2> /dev/null
echo -e "Escribe un puerto para Sockd"
read -p ": " sockcincox
if lsof -Pi :$sockcincox -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
sed -i '2i internal: 0.0.0.0 port = '"$sockcincox"'' /home/dante/danted.conf
sed -i '3i external: '"$MYIP"'' /home/dante/danted.conf
sleep 5
echo "Finalizando Instalacion"
screen -dmS sockdx /home/dante/sbin/sockd -f /home/dante/danted.conf
sleep 5
vpspack
fi
}
function socks5(){
echo -e "Instalando Socks5 espere..."
apt-get remove dante-server -y 1> /dev/null 2> /dev/null
apt-get purge dante-server -y 1> /dev/null 2> /dev/null
apt-get install dante-server -y 1> /dev/null 2> /dev/null
rm /etc/danted.conf 1> /dev/null 2> /dev/null
cp /etc/VpsPackdir/danted.conf /etc/danted.conf 1> /dev/null 2> /dev/null
echo -e "Escribe un puerto para Socks5"
read -p ": " sockcinco
if lsof -Pi :$sockcinco -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
sed -i '5i internal: 0.0.0.0 port = '"$sockcinco"'' /etc/danted.conf
sed -i '6i external: '"$ip"'' /etc/danted.conf
sleep 5
echo "Finalizando Instalacion"
systemctl restart danted
sleep 5
vpspack
fi
}
function openvpnweb16(){
echo -e "Se instalara OpenVPN Web Panel para Ubuntu 16 x64"
echo -e "Para su instalacion se requiere libre el puerto 443 y 943"
echo -e "Para continuar presiona cualquier tecla o Ctrl + C para cancelar la instalacion"
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
read -p " "
/etc/init.d/openvpn stop
wget --no-check-certificate https://openvpn.net/downloads/openvpn-as-latest-ubuntu16.amd_64.deb
dpkg -i openvpn-as-latest-ubuntu16.amd_64.deb
rm openvpn-as-latest-ubuntu16.amd_64.deb
echo -e "El usuario Administrador por default es : openvpn"
echo -e "Escriba el passwd para el usuario openvpn"
passwd openvpn
}
function openvpnweb18(){
echo -e "Se instalara OpenVPN Web Panel para Ubuntu 18 x64"
echo -e "Para su instalacion se requiere libre el puerto 443 y 943"
echo -e "Para continuar presiona cualquier tecla o Ctrl + C para cancelar la instalacion"
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
read -p " "
/etc/init.d/openvpn stop
wget --no-check-certificate https://openvpn.net/downloads/openvpn-as-latest-ubuntu18.amd_64.deb
dpkg -i openvpn-as-latest-ubuntu18.amd_64.deb
rm openvpn-as-latest-ubuntu18.amd_64.deb
echo -e "El usuario Administrador por default es : openvpn"
echo -e "Escriba el passwd para el usuario openvpn"
passwd openvpn
}
function detalhes_usuarios(){
clear
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ★ VPSPack v. $vpspackversion ★     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m ===================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip \033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m ===================================\033[1;33m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;31m ###############################\033[1;33m"
echo -e "\033[1;30m---------------------------------------------------------------\033[0m"
echo -e "\033[1;37m Usuario        Contraseña               Fecha E.          Logins S. \033[0m"
echo -e "\033[1;30m---------------------------------------------------------------\033[0m"
for users in `awk -F : '$3 > 900 { print $1 }' /etc/passwd |sort |grep -v "nobody" |grep -vi polkitd |grep -vi system-`
do
if cat /etc/VpsPackdir/limite/$users > /dev/null 2> /dev/null
then
limitecs=$(cat /etc/VpsPackdir/limite/$users)
else
limitecs="null"
fi
if  senha=$(cat /etc/VpsPackdir/senha/$users > /dev/null 2> /dev/null)
then
senha=$(cat /etc/VpsPackdir/senha/$users)
else
senha="null"
fi
data=$(chage -l $users |grep -i co |awk -F : '{print $2}')
if [ $data = never ] 2> /dev/null
then
date="Nunca"
fi
detalhesdata=$(printf '%-18s' "$data")
detalheslimit=$(printf '%-10s' "$limitecs")
detalhes=$(printf ' %-21s' "$users")
detalhespass=$(printf '%-18s' "$senha")
echo -e "\033[1;33m$detalhes $detalhespass $detalhesdata $detalheslimit\033[0m"
echo -e "\033[1;30m---------------------------------------------------\033[0m"
done
}
function restaurar_usuarios(){
echo -n "Digite el directorio del archivo de respaldo: "
read arq
echo -e "\033[1;37mRestaurando Usuarios...\033[0m"
for user in `cat $arq`
do
usuario=$(echo "$user" |awk -F : '{print $1}')
senha=$(echo "$user" |awk -F : '{print $2}')
if cat /etc/passwd |grep $usuario: 1> /dev/null 2>/dev/null
then
echo " " > /dev/null
else
echo "$user" |cut -d: -f3 1> /dev/null 2>/dev/null
if [ $? = 0 ]
then
limite=$(echo "$user" |awk -F : '{print $3}')
useradd -M -s /bin/false $usuario
(echo $senha ; echo $senha) | passwd $usuario > /dev/null 2> /dev/null
limit $usuario $limite 1> /dev/null 2> /dev/null
echo "$senha" > /etc/gerenciadorinfo/senha/$usuario
else
useradd -M -s /bin/false $usuario
(echo $senha ; echo $senha) | passwd $usuario > /dev/null 2> /dev/null
echo "$senha" > /etc/gerenciadorinfo/senha/$usuario
fi
echo -e "\033[1;37mUsuario: \033[1;31m$usuario \033[1;37mBackup: [\033[1;31mOk\033[1;37m]\033[0m"
fi
done
}
function banner(){
sshd_config_bak=$(cat /etc/ssh/sshd_config |grep -v "Banner")
echo "$sshd_config_bak" > /etc/ssh/sshd_config
echo "Banner /etc/banner" >> /etc/ssh/sshd_config
service ssh restart 1>/dev/null 2>/dev/null
service sshd restart 1>/dev/null 2>/dev/null
if [ -f /etc/banner ]
then
banner=$(cat /etc/banner)
else
banner="No hay banner de momento"
fi
echo -e "\033[1;32mBanner actual\n\n\033[1;37m$banner\n\033[0m"
echo "Escriba su banner (ctrl + c para sair )"
read -p ": " bannerssh
echo "$bannerssh" > /etc/banner
echo "Banner Modificado para OpenSSH"
service ssh restart 1> /dev/null 2>/dev/null
service sshd restart 1>/dev/null 2>/dev/null
}
function deletar_todos(){
for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "ubuntu" |grep -vi "nobody")
do
userpid=$(ps -u $user |awk {'print $1'})
kill "$userpid" 2>/dev/null
userdel $user
echo "$user Borrado"
done
}
clear
if [[ $1 == "" ]]
then
clear
figlet -p -f slant < /root/name
echo -e "\033[1;37m      【     ☬ VPSPack v. $vpspackversion ☬     】\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37m › Linux Dist:	$distribution › Version: $os_version\033[0m"
echo -e "\033[1;37m › IP VPS:       $ip\033[0m"
echo -e "\033[1;37m › Fecha Inst.:  $fecha\033[0m"
echo -e "\033[1;37m › M: $memoriatotal MB ›Uso: $memoriauso MB ›Libre: $memorialibre MB\033[0m"
echo -e "[\033[1;31m-\033[1;33m]\033[1;30m =======================================\033[1;33m"
echo -e "\033[1;37mSeleccione una opcion:  Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m]   › INSTALADOR OPENSSH Y SQUID\033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m
[\033[1;30m2\033[1;33m]   › GESTION DE USUARIOS\033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m
[\033[1;30m3\033[1;33m]   › MODIFICAR BANNER\033[1;33m
[\033[1;30m4\033[1;33m]   › PRUEBA DE VELOCIDAD (SPEEDTEST)\033[1;33m
[\033[1;30m5\033[1;33m]   › DETALLES DE SISTEMA\033[1;33m
[\033[1;30m6\033[1;33m]   › ACTIVAR FIREWALL[\033[1;31mRIESGO\033[1;33m] \033[1;32m$xiptables\033[1;33m
[\033[1;30m7\033[1;33m]   › RESETEAR FIREWALL[\033[1;31mRIESGO\033[1;33m]\033[1;33m
[\033[1;30m8\033[1;33m]   › PUERTOS TCP/UDP DISPONIBLES\033[1;33m
[\033[1;30m9\033[1;33m]   › HERRAMIENTAS & SCANNERS\033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m
[\033[1;30m10\033[1;33m]  › INSTALADORES EXTRAS\033[1;33m
[\033[1;30m11\033[1;33m]  › DESINSTALACION DE PAQUETES\033[1;33m
[\033[1;30m12\033[1;33m]  › MODIFICAR PUERTOS\033[1;33m
[\033[1;30m13\033[1;33m]  › ARCHIVOS DE CONFIGURACION\033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m
[\033[1;30m100\033[1;33m] › DESINSTALAR VPSPACK\033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m ########### SERVICIOS - \033[1;32mON \033[1;31m############\033[1;33m
[\033[1;30m-\033[1;33m]   → SSH Ports: \033[1;32m$sshports\033[1;33m→ Dropbear Ports: \033[1;32m$dropbearports \033[1;33m
[\033[1;30m-\033[1;33m]   → Squid Ports: \033[1;32m$squidports \033[1;33m
[\033[1;30m-\033[1;33m]   → SSL Ports: \033[1;32m$sslports \033[1;33m
[\033[1;30m-\033[1;33m]   → Shadow OBFS Ports: \033[1;32m$obfsports \033[1;33m
[\033[1;30m-\033[1;33m]   → Shadow R Ports: \033[1;32m$shadowrports \033[1;33m
[\033[1;30m-\033[1;33m]   → OpenVPN Ports: \033[1;32m$openvpnports \033[1;33m
[\033[1;30m-\033[1;33m]   → Socks5 Ports: \033[1;32m$dantedports \033[1;33m
[\033[1;30m-\033[1;33m]   → Sockd Ports: \033[1;32m$sockdports \033[1;33m
[\033[1;30m-\033[1;33m]   → Microsocks Ports: \033[1;32m$microports \033[1;33m
[\033[1;30m-\033[1;33m]   → V2ray Ports: \033[1;32m$v2rayports \033[1;33m
[\033[1;30m-\033[1;33m]   → Cloak Ports: \033[1;32m$cloakports \033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m ####### SERVICIOS EXTRAS - \033[1;32mON \033[1;31m#########\033[1;33m
[\033[1;30m-\033[1;33m]   → UDPWG Ports: \033[1;32m$badvpnports\033[1;33m→ Nginx: \033[1;32m$nginxports \033[1;33m
[\033[1;30m-\033[1;33m]   → DNS Server: \033[1;32m$xdns \033[1;33m
[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
echo -e "\033[1;33m ⫹⫺   ❲ • Escriba una opcion • ❳      \033[0m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1 | 01 )
configurarsquid;;
2 | 02 )
gestionusuarios;;
3 | 03)
banner;;
4 | 04)
speedtest.py;;
5 | 05)
sistemadetalhes;;
6 | 06)
firewallblock;;
7 | 07)
resetfirewall;;
8 | 08)
puertos;;
9 | 09)
herramientas;;
10)
extras;;
11)
delpaq;;
12)
addport;;
13)
config;;
100)
rm -rf /bin/speedtest.py 2>/dev/null
rm -rf /bin/deletarusuario 2>/dev/null
rm -rf /bin/redefinirusuario 2>/dev/null
rm -rf /bin/limite 2>/dev/null
rm -rf /bin/criarusuario 2>/dev/null
rm -rf /bin/vpspack 2>/dev/null;;
esac
